package com.example.survey_determination.controller;


import com.example.survey_determination.service.ObjectDamageInfoService;
import entity.object_damage_info;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (ObjectDamageInfo)表控制层
 *
 * @author makejava
 * @since 2022-01-11 00:00:03
 */
@CrossOrigin(methods = {RequestMethod.GET,RequestMethod.POST})
@RestController
@RequestMapping("objectDamageInfo")
public class ObjectDamageInfoController {
    /**
     * 服务对象
     */
    @Resource
    private ObjectDamageInfoService objectDamageInfoService;


    /**
     * 通过主键查询单条数据
     *
     * @return 单条数据
     */
    @RequestMapping("queryById")
    public object_damage_info queryById(String claimMainId) {
        return this.objectDamageInfoService.queryById(claimMainId);
    }
    @RequestMapping("selectAll")
    public object_damage_info selectAll() {
        return objectDamageInfoService.selectAll();
    }

    @RequestMapping("insert")
    public int insert(object_damage_info object_damage_info) {
        return this.objectDamageInfoService.insert(object_damage_info);
    }
    /**
     * 删除数据
     *
     * @param id 主键
     * @return 删除是否成功
     */
    @DeleteMapping
    public ResponseEntity<Boolean> deleteById(Integer id) {
        return ResponseEntity.ok(this.objectDamageInfoService.deleteById(id));
    }

}

